package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaMemberMapper;
import com.yiyahui.project.erp.domain.YiyaMember;
import com.yiyahui.project.erp.service.IYiyaMemberService;

/**
 * 会员Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-06-12
 */
@Service
public class YiyaMemberServiceImpl implements IYiyaMemberService 
{
    @Autowired
    private YiyaMemberMapper yiyaMemberMapper;

    /**
     * 查询会员
     * 
     * @param id 会员ID
     * @return 会员
     */
    @Override
    public YiyaMember selectYiyaMemberById(Long id)
    {
        return yiyaMemberMapper.selectYiyaMemberById(id);
    }

    /**
     * 查询会员列表
     * 
     * @param yiyaMember 会员
     * @return 会员
     */
    @Override
    public List<YiyaMember> selectYiyaMemberList(YiyaMember yiyaMember)
    {
        return yiyaMemberMapper.selectYiyaMemberList(yiyaMember);
    }

    /**
     * 新增会员
     * 
     * @param yiyaMember 会员
     * @return 结果
     */
    @Override
    public int insertYiyaMember(YiyaMember yiyaMember)
    {
        yiyaMember.setCreateTime(DateUtils.getNowDate());
        return yiyaMemberMapper.insertYiyaMember(yiyaMember);
    }

    /**
     * 修改会员
     * 
     * @param yiyaMember 会员
     * @return 结果
     */
    @Override
    public int updateYiyaMember(YiyaMember yiyaMember)
    {
        yiyaMember.setUpdateTime(DateUtils.getNowDate());
        return yiyaMemberMapper.updateYiyaMember(yiyaMember);
    }

    /**
     * 批量删除会员
     * 
     * @param ids 需要删除的会员ID
     * @return 结果
     */
    @Override
    public int deleteYiyaMemberByIds(Long[] ids)
    {
        return yiyaMemberMapper.deleteYiyaMemberByIds(ids);
    }

    /**
     * 删除会员信息
     * 
     * @param id 会员ID
     * @return 结果
     */
    @Override
    public int deleteYiyaMemberById(Long id)
    {
        return yiyaMemberMapper.deleteYiyaMemberById(id);
    }
}
